GtkSpinButton: Don't leak the gestures
authorMatthias Clasen <mclasen@redhat.com>
Fri, 2 May 2014 02:05:42 +0000 (22:05 -0400)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 23 May 2014 17:54:28 +0000 (19:54 +0200)
gtk/gtkspinbutton.c

index 976b8c6212ee651af6b9a8a295b96f6076134f38..fb0c40b3578b43a333ec61b21c09b16ca4d24cc2 100644 (file)
@@ -751,6 +751,14 @@ gtk_spin_button_finalize (GObject *object)
   if (priv->up_panel_context)
     g_object_unref (priv->up_panel_context);
 
+  gtk_widget_remove_controller (GTK_WIDGET (spin_button),
+                                GTK_EVENT_CONTROLLER (priv->long_press_gesture));
+  g_object_unref (priv->long_press_gesture);
+
+  gtk_widget_add_controller (GTK_WIDGET (spin_button),
+                             GTK_EVENT_CONTROLLER (priv->swipe_gesture));
+  g_object_unref (priv->swipe_gesture);
+
   G_OBJECT_CLASS (gtk_spin_button_parent_class)->finalize (object);
 }